<?php
Class Annotation {

	function __construct($id) {
		$query = mysql_query("SELECT * FROM `annotation` WHERE `id` = '$id';") or die(mysql_error());
		$result = mysql_fetch_object($query);
		if($result) {
			foreach($result as $key=>$value) {
				$this->$key = $value;
			}
		}
	}

	private function updateAnnotation() {
		$body = '';
		foreach($this as $key=>$value) {
			$body .= "` $key` = '$value'";
		}
		$query = mysql_query("UPDATE `annotation` SET $body") or die(mysql_error());
		return true;
	}
}